import { S } from '../../s';
import { IPSChartDataSetField } from './ipschart-data-set-field';
import { IPSDEChartDataSet } from './ipsdechart-data-set';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEChartDataSetImpl
  extends PSModelObjectImpl
  implements IPSDEChartDataSet
{
  get index(): number {
    return this.M.index;
  }

  protected pschartdatasetfields: IPSChartDataSetField[];
  getPSChartDataSetFields(): IPSChartDataSetField[] | null {
    return (
      this.pschartdatasetfields ||
      (this.pschartdatasetfields = this.fillChildListModel(
        this.M.getPSChartDataSetFields,
        S._ee,
      ) as IPSChartDataSetField[])
    );
  }

  findPSChartDataSetField(objKey: any): IPSChartDataSetField | null {
    return this.getPSModel5(
      S._ee,
      this.getPSChartDataSetFields(),
      objKey,
    ) as IPSChartDataSetField;
  }
  get cls(): string {
    return 'PSDEChartDataSetImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._f2 || cls == S._f3) return true;
    return super.instanceof(cls);
  }
}
